package c.c.b.a.b.a.i;

import c.c.b.a.b.a.e;
import c.c.b.a.b.a0;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;

/* compiled from: Jdk9Platform */
public final class b extends e {
    public final Method c;
    public final Method d;

    public b(Method method, Method method2) {
        this.c = method;
        this.d = method2;
    }

    public String d(SSLSocket sSLSocket) {
        try {
            String str = (String) this.d.invoke(sSLSocket, new Object[0]);
            return (str == null || str.equals("")) ? null : str;
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw e.f("unable to get selected protocols", e);
        }
    }

    public X509TrustManager f(SSLSocketFactory sSLSocketFactory) {
        throw new UnsupportedOperationException("clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+");
    }

    public void j(SSLSocket sSLSocket, String str, List<a0> list) {
        try {
            SSLParameters sSLParameters = sSLSocket.getSSLParameters();
            List e = e.e(list);
            Method method = this.c;
            Object[] objArr = new Object[1];
            ArrayList arrayList = (ArrayList) e;
            objArr[0] = arrayList.toArray(new String[arrayList.size()]);
            method.invoke(sSLParameters, objArr);
            sSLSocket.setSSLParameters(sSLParameters);
        } catch (IllegalAccessException | InvocationTargetException e2) {
            throw e.f("unable to set ssl parameters", e2);
        }
    }
}
